package main.java.com.fei.springboot.bean;


import lombok.Data;
import main.java.com.fei.springboot.constants.Status;

import java.io.Serializable;
import java.util.Date;

/**
 * @Auther 姬海威 [haiwei.ji@tigermed.net]
 * @Date 2017-6-8 20:53
 */
@Data
public class BootResponse<T> implements Serializable{

    private int code;
    private String msg;
    private T data;
    private Date timestamp = new Date();

    public BootResponse() {
        this(Status.SUCCESS.getCode(),Status.SUCCESS.getMsg());
    }

    public BootResponse(int code, String msg) {
        this(null, code, msg);
    }

    public BootResponse(T data) {
        this(data, Status.SUCCESS.getCode(),Status.SUCCESS.getMsg());
    }

    public BootResponse(T data, int code, String msg) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }
}
